<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <!-- basic styles -->
        <link href="../../assets/js/plugin/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
        <link type="text/css" rel="stylesheet" href="../../assets/js/plugin/jquery-ui/css/jquery-ui.css" />
        <!--<link href="../../assets/js/plugin/datepicker/css/jquery-datepicker.css" rel="stylesheet" media="screen" />-->
        <!--<link href="../../assets/js/plugin/check/check.css" rel="stylesheet" media="screen" />-->
        <link rel="stylesheet" href="../../assets/css/ace.min.css" />
        <!-- <link rel="stylesheet" type="text/css" media="all" href="../../assets/js/date-time/daterangepicker-bs3.css"/> -->
        <link rel="stylesheet" href = "../../assets/js/plugin/laydate/need/laydate.css" />
        <style>
            .controls span.help-inline {
                font-size: 12px;
                color: #999
            }
        </style>

    </head>

    <body>
        <div class="main-container">
            <h4 style="padding-left:20px; margin-top: 20px;" class='header smaller lighter blue'>流量分析结果上报策略添加</h4>
            <form class="form-horizontal">
                <div style="width:50%; min-width:400px; float:left;">
                    <div class="control-group">
                        <label class="control-label" for="policy_desc">策略名称:</label>
                        <div class="controls">
                            <input type="text" id="policy_desc" name="policy_desc" class="policy_desc" required>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="Packet_Type">UD报文类型:</label>
                        <div class="controls">
                            <select class="stair Packet_Type" id="Packet_Type" >
                                <option>请选择....</option>
                            </select>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="Packet_Subtype">UD报文子类型:</label>
                        <div class="controls">
                            <select class="second Packet_Subtype" id="Packet_Subtype">
                                <option>请选择....</option>
                            </select>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="R_StartTime">分析结果上报开始时间:</label>
                        <div class="controls">
                            <input type="text" name="R_StartTime" id="R_StartTime" class="form-control R_StartTime dateValidator" />
                            <!--<input type="text" class="R_StartTime" id="R_StartTime" placeholder="开始时间"/>-->
                            <!--<span class="help-inline">提示：空值表示立即上报</span>-->
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="R_EndTime">分析结果上报结束时间:</label>
                        <div class="controls">
                            <input type="text" name="R_EndTime" id="R_EndTime" class="form-control R_EndTime dateValidator" />
                            <!--<input type="text" id='R_EndTime' class="R_EndTime" placeholder="结束时间" />-->
                            <!--<span class="help-inline">提示：空值表示一直上报</span>-->
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="R_Freq">分析结果上报周期:</label>
                        <div class="controls">
                            <select id="R_Freq" class="R_Freq" >
                                <option value="0">流结束时即上报</option>
                                <option value="1">每 5 分钟上报，从整点时间开始</option>
                                <option value="2">每 1 小时上报(整点时间)</option>
                                <option value="3">每 3 小时上报(整点时间)</option>
                                <option value="4">每天上报</option>
                                <option value="5">每 30 秒上报</option>
                                <option value="6">每 1 分钟上报</option>
                                <option value="7">每 3 分钟上报</option>
                            </select>
                        </div>
                    </div>

                </div>

                <div style=" width:50%; min-width:400px; float:left;"> 
                    <div class="control-group">
                        <label class="control-label" for="R_DestIPLength">上报服务器 IP地址长度:</label>
                        <div class="controls">
                            <select id="R_DestIPLength" class="R_DestIPLength">
                                <option value="4">IPv4</option>
                                <option value="16">IPv6</option>
                            </select>
                            <!--<span class="help-inline">提示：IPv4 采用网络序十进制，4 字节；IPv6 采用十六进制,16 字节</span>-->
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="R_DestIP">上报服务器 IP地址:</label>
                        <div class="controls">
                            <input type="text" class="R_DestIP ip" id="R_DestIP" name="R_DestIP" required/>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="R_DestPort">接收上报数据的服务器端口号:</label>
                        <div class="controls">
                            <input type="text" class="span3 R_DestPort number" name="R_DestPort" value="50001" id="R_DestPort" required/>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="R_Method">Ud 记录上报方式:</label>
                        <div class="controls">
                            <select id="R_DestIPLength" class="R_Method" >
                                <option value="1">Socket 方式上报</option>
                                <option value="2">sftp 方式上报</option>
                            </select>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="UserName">登录 sftp 服务器的用户名:</label>
                        <div class="controls">
                            <input type="text" class="UserName" id="UserName"/>
                            <!--<span class="help-inline">提示：最长为 8 字节，不足系统自动以 0 补齐。</span>-->
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="Password">sftp 服务器登录密码:</label>
                        <div class="controls">
                            <input type="text" class="Password" id="Password" />
                            <!--<span class="help-inline">提示：长度必须为 8 字节。</span>-->
                        </div>
                    </div>
                </div>
                <div style=" width:100%; min-width:400px; float:left; border-top: 1px solid #d5e3ef;">
                    <div class="control-group" style=" padding-top: 10px;">
                        <div class="controls">
                            <a href="javascript:void(0)" class="btn btn-primary" onclick='edit()'>&nbsp;保&nbsp;存&nbsp;</a>
                            <a href="javascript:void(0)" class="btn btn-danger" onclick='previous()'>&nbsp;返&nbsp;回&nbsp;</a>
                        </div>
                    </div>
                </div>
            </form>
        </div>
        <script src="../../assets/js/jquery.js"></script>
        <script src="../../assets/js/plugin/bootstrap/js/bootstrap.min.js"></script>
        <script type='text/javascript' src="../../assets/js/plugin/jquery-ui/jquery-ui.js"></script>
        <!--<script src="../../assets/js/plugin/datepicker/js/jquery-datepicker.js"></script>
        <script src="../../assets/js/date-time/moment.js"></script>
        <script src="../../assets/js/date-time/daterangepicker.js"></script>-->
        <script src="../../assets/js/plugin/laydate/laydate.js"></script>
        <script src="../../assets/js/plugin/menu/menu.js"></script>
        <!--<script src="../../assets/js/logic/overlayer.js"></script>-->
        <script src="../../assets/js/jquery.validate.js"></script>
        <script src="../../assets/js/jquery.validate-util.js"></script>
        <script src="../../assets/js/Base64.js"></script>
        <script src="logic.js"></script>
        <script>
                                var base64 = new Base64();
                                var type = getQueryString("type");
                                var DepotID = getQueryString("DepotID");
                                var DepotName = getQueryString("DepotName");
                                DepotName = base64.decode(DepotName);
                                var id = getQueryString("id");
                                $(function() {
                                    //二级联动菜单
                                    $('body').menu({
                                        obj: objs,
                                        data: datas
                                    });
                                    showData();
                                    $("#Packet_Type").change(function() {
                                        optionip($(this).val());
                                    });
//                                    console.log("type:" + type + "\tDepotID:" + DepotID + "\tDepotName:" + DepotName + "\tid:" + id)
                                    $(".header").text(DepotName + "  策略管理");
                                    //时间插件
                                    var start = {
                                        elem: '.R_StartTime',
                                        format: 'YYYY/MM/DD hh:mm:ss',
                                        istime: true,
                                        istoday: false,
                                        festival: true,
                                        choose: function(datas){
                                             end.min = datas; //开始日选好后，重置结束日的最小日期
                                             end.start = datas //将结束日的初始值设定为开始日
                                        }
                                    };
                                    var end = {
                                        elem: '.R_EndTime',
                                        format: 'YYYY/MM/DD hh:mm:ss',
                                        istime: true,
                                        istoday: false,
                                        festival: true,
                                        choose: function(datas){
                                            start.max = datas; //结束日选好后，重置开始日的最大日期
                                        }
                                    };
                                    laydate(start);
                                    laydate(end);
//                                    setInterval(function() {
//                                        parent.$("#page-content").attr("height", $("html").height());
//                                    }, 500);
                                });
        </script>
    </body>
</html>
